
Use Tunga;

GO
--Insert
Alter PROC insertAdmin
	@[username] nvarchar(100),
	@[password] nvarchar(100)
AS
INSERT INTO Admin([username],[password])
 VALUES(@[username],@[password])


GO
--update
Alter PROC updateAdmin
	@[id] int,
	@[username] nvarchar(100),
	@[password] nvarchar(100)
AS
UPDATE Admin SET
	[username]=@[username],
	[password]@[password]	
WHERE [id]=@[id]
GO
--Delete
CREATE PROC deleteAdmin
	@[id] int
AS
	DELETE FROM Admin WHERE id=@[id]
GO
--Get All
CREATE PROC getAllAdmin
AS
	SELECT * from Admin 
GO
--Login
CREATE PROC AdminLogin
	@[username] nvarchar(100),
	@[password] nvarchar(100) 	
AS
SELECT * from Admin where [username]=@[username] and [password]=@[password]
GO
--Get Admin By ID
CREATE PROC getAdminByID
	@[id] int
AS
	SELECT * from Admin WHERE [id]=@[id]
Go
--Check Exist Admin
CREATE PROC checkExistAdmin
	@[username] nvarchar(100)
AS
SELECT * from Admin where [username]=@[username]
GO
